<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
<?php
include 'conn.php';
session_start();
$name = $_POST['uname'];
$pwd = $_POST['pwd'];
$sql = "select * from adusers where name='$name' and pwd='$pwd'";
$result = mysqli_query($conn, $sql);

$total = mysqli_num_rows($result);
if ($total != 0) {
	$_SESSION['un'] = $name;
	$_SESSION['m'] = $pwd;
	echo "<script>alert('用户名密码正确');window.location.href='index.php'</script>";
} else {

	echo "<script>alert('用户名密码错误');window.location.href='login.php'</script>";
}
?>
</body>
</html>